#pragma once

#ifndef STATION_H
#define STATION_H

#include <QtCore/QPoint>
#include <QtCore/QString>
#include <QtGui/QWidget>
#include <QtGui/QPainter>
#include <QtGui/QStyle>
#include <QtGui/QPolygonF>
#include <QtGui/QStyleOptionGraphicsItem>
#include <QtGui/QGraphicsItem>
#include "../colliding-trains/data.h"

class CStation :
	public QGraphicsItem, public station
{
protected:
	//QWidget  *m_graph;
	QString   m_name;
	int       m_id;
	QPolygonF m_polygon;
public:
	CStation(QGraphicsItem * parent = 0);
	~CStation(void);

	/*id is set automatically, by increment*/
	void setstation(const QPointF & point, const QString & name);
	void drawstation();
	QPolygonF polygon();

	QRectF boundingRect() const;
    //QPainterPath shape() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
public:
	enum { Type = UserType + 15 };
	int type() const
         { return Type;}
};

#endif //STATION_H
